// plugins/response.js
const statusCode = async function (fastify) {
  console.log('[INFO] 响应插件已加载') // 启动时查看控制台
  fastify.decorateReply('success', function (data) {
    return this.code(200).send({
      code: this.statusCode,
      message: '操作成功！',
      data,
    })
  })
}

module.exports = statusCode
